Optimal. Leaf size=96 \[ \frac {2 a^2 \tan ^3(c+d x)}{3 d}+\frac {2 a^2 \tan (c+d x)}{d}+\frac {7 a^2 \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a^2 \tan (c+d x) \sec ^3(c+d x)}{4 d}+\frac {7 a^2 \tan (c+d x) \sec (c+d x)}{8 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11, antiderivative size = 96, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {2757, 3768, 3770, 3767} \[ \frac {2 a^2 \tan ^3(c+d x)}{3 d}+\frac {2 a^2 \tan (c+d x)}{d}+\frac {7 a^2 \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a^2 \tan (c+d x) \sec ^3(c+d x)}{4 d}+\frac {7 a^2 \tan (c+d x) \sec (c+d x)}{8 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2757
Rule 3767
Rule 3768
Rule 3770
Rubi steps
\begin {align*} \int (a+a \cos (c+d x))^2 \sec ^5(c+d x) \, dx &=\int \left (a^2 \sec ^3(c+d x)+2 a^2 \sec ^4(c+d x)+a^2 \sec ^5(c+d x)\right ) \, dx\\ &=a^2 \int \sec ^3(c+d x) \, dx+a^2 \int \sec ^5(c+d x) \, dx+\left (2 a^2\right ) \int \sec ^4(c+d x) \, dx\\ &=\frac {a^2 \sec (c+d x) \tan (c+d x)}{2 d}+\frac {a^2 \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {1}{2} a^2 \int \sec (c+d x) \, dx+\frac {1}{4} \left (3 a^2\right ) \int \sec ^3(c+d x) \, dx-\frac {\left (2 a^2\right ) \operatorname {Subst}\left (\int \left (1+x^2\right ) \, dx,x,-\tan (c+d x)\right )}{d}\\ &=\frac {a^2 \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {2 a^2 \tan (c+d x)}{d}+\frac {7 a^2 \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a^2 \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {2 a^2 \tan ^3(c+d x)}{3 d}+\frac {1}{8} \left (3 a^2\right ) \int \sec (c+d x) \, dx\\ &=\frac {7 a^2 \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {2 a^2 \tan (c+d x)}{d}+\frac {7 a^2 \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a^2 \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {2 a^2 \tan ^3(c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 6.43, size = 797, normalized size = 8.30 \[ -\frac {7 (\cos (c+d x) a+a)^2 \log \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )-\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right ) \sec ^4\left (\frac {c}{2}+\frac {d x}{2}\right )}{32 d}+\frac {7 (\cos (c+d x) a+a)^2 \log \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )+\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right ) \sec ^4\left (\frac {c}{2}+\frac {d x}{2}\right )}{32 d}+\frac {(\cos (c+d x) a+a)^2 \sin \left (\frac {d x}{2}\right ) \sec ^4\left (\frac {c}{2}+\frac {d x}{2}\right )}{3 d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )-\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )}+\frac {(\cos (c+d x) a+a)^2 \sin \left (\frac {d x}{2}\right ) \sec ^4\left (\frac {c}{2}+\frac {d x}{2}\right )}{3 d \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )+\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )}+\frac {(\cos (c+d x) a+a)^2 \left (29 \cos \left (\frac {c}{2}\right )-13 \sin \left (\frac {c}{2}\right )\right ) \sec ^4\left (\frac {c}{2}+\frac {d x}{2}\right )}{192 d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )-\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )^2}+\frac {(\cos (c+d x) a+a)^2 \left (-29 \cos \left (\frac {c}{2}\right )-13 \sin \left (\frac {c}{2}\right )\right ) \sec ^4\left (\frac {c}{2}+\frac {d x}{2}\right )}{192 d \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )+\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )^2}+\frac {(\cos (c+d x) a+a)^2 \sin \left (\frac {d x}{2}\right ) \sec ^4\left (\frac {c}{2}+\frac {d x}{2}\right )}{12 d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )-\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )^3}+\frac {(\cos (c+d x) a+a)^2 \sin \left (\frac {d x}{2}\right ) \sec ^4\left (\frac {c}{2}+\frac {d x}{2}\right )}{12 d \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )+\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )^3}+\frac {(\cos (c+d x) a+a)^2 \sec ^4\left (\frac {c}{2}+\frac {d x}{2}\right )}{64 d \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )-\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )^4}-\frac {(\cos (c+d x) a+a)^2 \sec ^4\left (\frac {c}{2}+\frac {d x}{2}\right )}{64 d \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )+\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )^4} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.89, size = 111, normalized size = 1.16 \[ \frac {21 \, a^{2} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 21 \, a^{2} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (32 \, a^{2} \cos \left (d x + c\right )^{3} + 21 \, a^{2} \cos \left (d x + c\right )^{2} + 16 \, a^{2} \cos \left (d x + c\right ) + 6 \, a^{2}\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.68, size = 122, normalized size = 1.27 \[ \frac {21 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 21 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (21 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 77 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 83 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 75 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{24 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.14, size = 102, normalized size = 1.06 \[ \frac {7 a^{2} \sec \left (d x +c \right ) \tan \left (d x +c \right )}{8 d}+\frac {7 a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8 d}+\frac {4 a^{2} \tan \left (d x +c \right )}{3 d}+\frac {2 a^{2} \left (\sec ^{2}\left (d x +c \right )\right ) \tan \left (d x +c \right )}{3 d}+\frac {a^{2} \left (\sec ^{3}\left (d x +c \right )\right ) \tan \left (d x +c \right )}{4 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.31, size = 145, normalized size = 1.51 \[ \frac {32 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} a^{2} - 3 \, a^{2} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, a^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{48 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.35, size = 141, normalized size = 1.47 \[ \frac {7\,a^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{4\,d}-\frac {\frac {7\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{4}-\frac {77\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{12}+\frac {83\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{12}-\frac {25\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________